<template>
  <div class="cityList">
    <div class="breadcrumbNav">
      <vBreadcrumb :breadcrumb="breadcrumb"></vBreadcrumb>
    </div>
    <div class="ul">
      <list :itemData="itemData" :route="route"></list>
    </div>
  </div>

</template>
<script>
  import list from '../../common/list.vue'
  import vBreadcrumb from '../../common/breadcrumb.vue'
  import ajax from '../../../utils/ajax/index'
  export default {
    data () {
      return {
        breadcrumb: [
          {
            name: '项目总览',
            path: 'cityList'
          }
        ],
        itemData: [],
        route: 'projectList'
      }
    },
    components: {
      list,
      vBreadcrumb
    },
    mounted () {
      this.result()
    },
    methods: {
      result () {
        let that = this
        let url = that.api.cityList
        let store = that.$store
        ajax.get(url, {}, store, true).then((res) => {
          console.log(res.data)
          let data = res.data
          let temp = []
          for (let i = 0; i < data.length; i++) {
            let obj = data[i]
            obj['name'] = data[i].cityName
            obj['num'] = data[i].processNum
            obj['txt'] = data[i].txt
            obj['time'] = data[i].startupTime + '启动'
            temp.push(obj)
          }
          that.itemData = data
        })
      }
    }
  }
</script>

